POV-Ray : Newsgroups : povray.binaries.images : YAEM (Yet Another Eye Macro) : YAEM (Yet Another Eye Macro) Server Time
5 Nov 2024 18:25:36 EST (-0500)
  YAEM (Yet Another Eye Macro)  
From: Artemia Salina
Date: 29 Jun 2006 13:23:09
Message: <44a40c7d@news.povray.org>
Eternally WIP, here's a human eye macro that I've been working on for
quite some time. Textures for the blood veins and iris are fractal
pigment patterns. Still not completely happy with it. Rotation of the
iris pigment elements needs to be worked on to get rid of the spiral
effect and more control of the blood veins is needed, but the pupils
will dilate and eye color is customizable via macro parameters.

----------------------------------------------------------------

// AS - 06 Eye Macro for POV-Ray
// Usage: #include "eye.inc"
//        object{Eye(Brown, 0.5) translations}


#include "colors.inc"   // Standard Color definitions
#include "textures.inc" // Standard Texture definitions
#include "math.inc"
#include "rand.inc"

#declare N1 = seed(12345);
#declare N2 = seed(22345);
#declare N3 = seed(32345);
#declare N4 = seed(42345);
#declare N5 = seed(52345);
#declare N6 = seed(62345);
#declare N7 = seed(72345);
#declare N8 = seed(82345);
#declare N9 = seed(92345);

#macro BloodShot(N, T, C)
texture{
         pigment {
                 mandel 5000  * RRand(1, 5, N)
                 turbulence RRand(0.2, 10.9, N)
                 scale <1,1,1>
                 translate z*(T/2)
                 rotate <0, 0, RRand(0, 360, N)*(T/10)>
                 color_map {
                         [0.010  rgbt 1]
                         [0.010 C ]
                         [0.200  C ]
                         [0.200 rgbt 1]
                 }
         }
}
#end
#macro ITex(P, CC, R, N)
texture {
         pigment {
                 mandel 60
                 turbulence RRand(5, 6, N)
                 omega 0.75
                 scale <(P/1.5)+1.75, .4, .1>
                 rotate <0, RRand(2, 4, N), R*0.5>
                 color_map {
                         [0.007 rgbt 1 ]
                         [0.007 rgbt <0.416471-CC.red, 0.658824-CC.green,
0.639216-CC.blue, 0.7> ]
                         [0.029 rgbt <0.536471-CC.red, 0.458824-CC.green,
0.539216-CC.blue, 0.9> ]
                         [0.029 rgbt 1 ]
                 }
         }
}
#end

// Pupil == 0.0 - open  1.0 - closed
#macro Eye(Color, Pupil)
union{
         cone{   <0,0,-0.43>, 0.234
                 <0,0, -0.42>, 0.05+(Pupil/10)
                 open

                 texture{
                         pigment {color Color}

                         finish  {ambient 0.30
                                 brilliance 3
                                 diffuse 0.4
                                 metallic
                                 specular 0.70
                                 roughness 1/60
                                 reflection 0.25
                         }
                 }
                 #local QQ = 0;
                 #while (QQ <= 720)
                 ITex(Pupil, Color+0.5, QQ, N1)
                 ITex(Pupil, Color*0.75, QQ+5, N1)
                 #local QQ = QQ + 20;
                 #end
         }

         torus{ 0.238, 0.01
                 pigment{rgbt <0.75, 0.75, 0.75, 0.200>}
                 scale <1, 0.4, 1>
                 rotate x*90
                 translate <0,0,-0.40>
         }

         difference { //Eyeball
                 sphere {0, 0.5
                         texture{pigment{color White}}

                         BloodShot(N1, 1, Red)
                         BloodShot(N2, 2, Red)
                         BloodShot(N3, 3, Red)
                         BloodShot(N4, 4, Red)
                         BloodShot(N5, 5, Red)
                         BloodShot(N6, 6, Red)
                         BloodShot(N7, 7, Red)
                         BloodShot(N8, 8, Red)
                         BloodShot(N9, 9, Red)
                         texture {
                           pigment { color rgbt <0.98, 0.98, 0.98, 0.9> }
                                 finish  {
                                         ambient 0.1
                                         diffuse 0.1
                                         reflection 0.1
                                         specular 0.8
                                         roughness 0.0005
                                 }
                         }

                       interior {ior 1.0}
                       normal {dents 0.5 scale <.15,.15,.1> turbulence 1}
                       hollow
                 }
                 sphere{<0,0,-0.5>,0.25}
                 hollow
                         BloodShot(N7, 7, Red)
                         BloodShot(N8, 8, Red)
                         BloodShot(N9, 9, Red)
                         texture {
                           pigment { color rgbt <0.98, 0.98, 0.98, 0.9> }
                                 finish  {
                                         ambient 0.1
                                         diffuse 0.1
                                         reflection 0.1
                                         specular 0.8
                                         roughness 0.0005
                                 }
                         }

                       interior {ior 1.0}
                       normal {dents 0.5 scale <.15,.15,.1> turbulence 1}
                       hollow
                 }
                 sphere{<0,0,-0.5>,0.25}
                 hollow
         }
         sphere {0,0.25
                 texture {
                         pigment { color rgbt <0.98, 0.98, 0.98, 0.9> }
                         finish  {
                                 ambient 0.1
                                 diffuse 0.1
                                 reflection 0.1
                                 specular 0.8
                                 roughness 0.0005
                         }
                 }
                 interior {ior 1.0}
                 hollow
                 scale <1,1,0.6>
                 translate <0,0,-0.4>
         }

}
#end


Post a reply to this message


Attachments:
Download 'eye-test.jpg' (86 KB)

Preview of image 'eye-test.jpg'
eye-test.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.